Data storage devices, such as disk drives and solid state drives are employed in numerous areas such as computer systems (e.g., desktops, laptops, portables, etc.) and consumer devices (e.g., music players, cell phones, cameras, etc.). User data is typically stored in a non-volatile memory, such as a magnetic disk or a non-volatile semiconductor memory (e.g., flash memory). In order to enable defect mapping (mapping out of defective memory segments of the non-volatile memory), as well as enable wear leveling in solid state drives, the memory segments are typically accessed indirectly by mapping logical block addresses (LBAs) to physical block addresses (PBAs). That is, host access commands (write or read) comprise an LBA that is mapped to a PBA representing a memory segment, where the PBA may change over time due to relocating from a grown defect, or wear leveling to evenly distribute access to the memory segments.
When accessing a memory segment using LBA to PBA mapping, it is important for the storage device to access the correct memory segment. For various reasons, such as malfunctioning firmware, a data storage device may write/read data to/from the wrong PBA, or write the wrong data to the correct PBA, perhaps because of an error in accessing a cache buffer, or in the LBA to PBA mapping algorithm, or in the mapping of PBA to the memory segment. The prior art has employed various forms of “data path protection” wherein the LBA may be used during the write/read operations to ensure the correct memory segment is read and that the memory segment stores the correct data during a read operation. For example, the prior art has suggested to seed an error code generator with the LBA during writing and reading which helps ensure the correct memory segment is being accessed, and that the correct data was written to the memory segment.